package com.yan.common.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 注册参数
 * @author yanchen
 * @since 2025/6/20 19:52
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class RegisterDto {
    @NotBlank(message = "用户名不能为空")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, message = "密码长度不能小于6位")
    private String password;

    @NotNull(message = "用户类型不能为空")
    private Integer userType;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    @NotBlank(message = "邮箱验证码不能为空")
    @Size(min = 6, message = "邮箱验证码必须为6位")
    @Size(max = 6, message = "邮箱验证码必须为6位")
    private String emailCode;
}
